package com.core.dao;

import com.core.dao.jdbcmysql.JdbcMysqlFactory;
import com.core.dao.mybatismysql.MybatisMysqlFactory;
import com.core.dao.redis.RedisFactory;

public abstract class AbstractDaoFactory {

    public static final int MYBATIS_MYSQL_DAO = 1;
    public static final int JDBC_MYSQL_DAO = 2;
    public static final int REDIS_DAO = 3;

    public static AbstractDaoFactory create(int factory) {
        switch (factory) {
            case MYBATIS_MYSQL_DAO:
                return new MybatisMysqlFactory();
            case JDBC_MYSQL_DAO:
                return new JdbcMysqlFactory();
            case REDIS_DAO:
                return new RedisFactory();
        }
        throw new RuntimeException("...");
    }

    public abstract IProductDao getProductDao();

    public abstract IPasswordDao getPasswordDao();

    public abstract IUserDao getUserDao();

    public abstract IReportingDao getReportingDao();

    public abstract IOnlineDao getOnlineDao();

    public abstract IShoppingOrderDao getShoppingOrderDao();

    public abstract IDoubleDao getDoubleDao();

    public abstract ISingleDao getSingleDao();

    public abstract IGoodsDao getGoodsDao();

    public abstract ICarItemDao getCarItemdao();

    public abstract IShipmentsDao getShipmentsDao();

    public abstract IReceivingDao getReceivingDao();

    public abstract IUserAddressDao getUserAddressDao();

    public abstract ITransaction getTransaction();
}
